//
//  SymbolResultConverter.m
//  LinkMap
//
//  Created by aron on 2022/5/7.
//  Copyright © 2022 ND. All rights reserved.
//

#import "SymbolResultConverter.h"
#import "ObjectResult.h"

@implementation SymbolResultConverter

/// /Users/aron/MyWorkSpaces/CodeRepos/bbframework_iOS_New_HQY/proj.ios/Pods/GDTMobSDK/lib/libGDTMobSDK.a(GDTSplashLongVideoBanner.o)
/// 转换为以下数据结构
/// GDTSplashLongVideoBanner -> ObjectResult
/// @param objects ObjectResult数组
- (NSDictionary *)convert2MapData:(NSArray *)objects {
    NSMutableDictionary *mapData = [NSMutableDictionary new];
    
    for (ObjectResult *object in objects) {
        NSString *combObjName = [[object.file componentsSeparatedByString:@"/"] lastObject];//libGDTMobSDK.a(GDTSplashLongVideoBanner.o)
        NSRange startRange = [combObjName rangeOfString:@"("];
        NSRange endRange = [combObjName rangeOfString:@".o)"];
        if (startRange.length > 0 && endRange.length > 0 ) {
            NSString *pureName = [combObjName substringWithRange:NSMakeRange(startRange.location + 1, endRange.location - startRange.location - 1)];
            mapData[pureName] = object;
        }
    }
    
    return mapData;
}

@end
